<?php js_validate();?>
<style type="text/css">
input,textarea,select{
	background-color:#fff; color:#000; background-color:#fff;	
}
</style>
<form id="form-validated" class="input" action="<?php echo $own_links;?>save" method="post" enctype="multipart/form-data">
		<input type="hidden" name="form_id" id="form_id" value="<?php echo isset($val->form_id)?$val->form_id:'';?>" />
        <a href="#" onclick="$('#table-form').hide();">Sembunyikan Form</a> &nbsp; <a href="#" onclick="$('#table-form').show();">Tampilkan Form</a>
		<table class="table-form" style="width:95%;" id="table-form" border="0">
			<tr>
				<td>Nama Principal</td>
				<td><input type="text" id="form_principal_name" name="form_principal_name" disabled="disabled" class="validate[required]"size="50" value="<?php echo isset($val->form_principal_name)?$val->form_principal_name:'';?>" /></td>
			</tr>
            <tr valign="top">
				<td>Alamat Principal</td>
				<td><textarea cols="50" rows="2" id="form_principal_address" disabled="disabled" name="form_principal_address" class="validate[required]" /><?php echo isset($val->form_principal_address)?$val->form_principal_address:'';?></textarea></td>
			</tr>
            <tr>
				<td>Nama Obligee</td>
				<td><input type="text" id="form_obligee_name" name="form_obligee_name" disabled="disabled" class="validate[required]"size="50" value="<?php echo isset($val->form_obligee_name)?$val->form_obligee_name:'';?>" /></td>
			</tr>
            <tr valign="top">
				<td>Alamat Obligee</td>
				<td><textarea cols="50" rows="2" id="form_obligee_address" disabled="disabled" name="form_obligee_address" class="validate[required]" /><?php echo isset($val->form_obligee_address)?$val->form_obligee_address:'';?></textarea></td>
			</tr>
            
            <!-- <tr>
				<td>Nama Marketing</td>
				<td>
                	<select name="form_marketing" class="validate[required]" disabled="disabled" id="form_marketing">
                    	<option value="">Pilih Tipe Marketing</option>
                        <?php
							if(count($marketing) > 0){
								foreach($marketing as $r){
									$t = isset($val->form_marketing)?$val->form_marketing:"";
									$s = ($r->marketing_id==$t)?"selected='selected'":'';
									echo "<option value='".$r->marketing_id."' $s >".$r->marketing_name."</option>";
								}
							}
						?>
                    </select>
                </td>
			</tr> -->
			<input type="hidden" value="0" name="form_marketing" disabled="disabled" id="form_marketing" />
			
            <tr>
				<td>Tipe Bank Garansi</td>
				<td>
                	<select name="form_bank_garansi_type" class="validate[required]" disabled="disabled" id="form_bank_garansi_type">
                    	<option value="">Pilih Tipe Bank Garansi</option>
                        <option value="penawaran" <?php echo (isset($val->form_bank_garansi_type)&& $val->form_bank_garansi_type=="penawaran")?'selected="selected"':'';?>>Penawaran</option>
                        <option value="pelaksanaan" <?php echo (isset($val->form_bank_garansi_type)&& $val->form_bank_garansi_type=="pelaksanaan")?'selected="selected"':'';?> >Pelaksanaan</option>
                        <option value="uang muka" <?php echo (isset($val->form_bank_garansi_type)&& $val->form_bank_garansi_type=="uang muka")?'selected="selected"':'';?> >Uang Muka</option>
                        <option value="pemeliharaan" <?php echo (isset($val->form_bank_garansi_type)&& $val->form_bank_garansi_type=="pemeliharaan")?'selected="selected"':'';?> >Pemeliharaan</option>
                    </select>
                </td>
			</tr>
            <tr>
            	<td>Mata Uang</td>
                <td>
                	<select name="form_mata_uang" class="validate[required]" disabled="disabled" id="form_mata_uang">
                        <?php
							if(count($curr) > 0){
								foreach($curr as $r){
									$t = isset($val->form_mata_uang)?$val->form_mata_uang:"";
									$s = ($r->cur_id==$t)?"selected='selected'":'';
									echo "<option value='".$r->cur_id."' $s >".$r->cur_name."</option>";
								}
							}
						?>
                    </select>
                </td>
            </tr>
            <tr>
				<td>Nilai Project</td>
				<td>
                    <input type="text" id="form_contract_value" disabled="disabled" name="form_contract_value" class="validate[required,custom[onlyNumber]]"size="30" value="<?php echo isset($val->form_contract_value)?$val->form_contract_value:'';?>" /></td>
			</tr>
            <tr>
				<td>Nilai Jaminan</td>
				<td>                	
                    <input type="text" id="form_guarantee_value" disabled="disabled" name="form_guarantee_value" class="validate[required,custom[onlyNumber]]"size="30" value="<?php echo isset($val->form_guarantee_value)?$val->form_guarantee_value:'';?>" /></td>
			</tr>
            <tr>
				<td>Nomor Dokumen</td>
				<td><input type="text" id="form_document_number" disabled="disabled" name="form_document_number" class="validate[required]"size="50" value="<?php echo isset($val->form_document_number)?$val->form_document_number:'';?>" /></td>
			</tr>
            <tr valign="top">
				<td>Deskripsi Dokumen</td>
				<td><textarea cols="50" rows="2" id="form_document_desc" disabled="disabled" name="form_document_desc" class="validate[required]" /><?php echo isset($val->form_document_desc)?$val->form_document_desc:'';?></textarea></td>
			</tr>
            <tr valign="top">
				<td>Pekerjaan</td>
				<td>
                <textarea cols="50" id="form_job" disabled="disabled" name="form_job" class="validate[required]" rows="3"><?php echo isset($val->form_job)?$val->form_job:'';?></textarea>
			</tr>
            <tr>
				<td>Jangka Waktu</td>
				<td><input type="text" id="form_as_long_day" disabled="disabled" name="form_as_long_day" class="validate[required]"size="5" value="<?php echo isset($val->form_as_long_day)?$val->form_as_long_day:'';?>" /> Hari</td>
			</tr>
            <tr>
				<td>Mulai Tanggal </td>
				<td><input type="text" id="form_start_date" name="form_start_date" disabled="disabled" class="validate[required] picker" readonly="readonly" size="15" value="<?php echo isset($val->form_start_date)?$val->form_start_date:'';?>" /> s/d <input type="text" id="form_end_date" name="form_end_date" class="validate[required] picker" disabled="disabled" readonly="readonly" size="15" value="<?php echo isset($val->form_end_date)?$val->form_end_date:'';?>" /></td>
			</tr>
            <tr valign="top">
				<td>Dokumen</td>
				<td>
						 <div id="formulir_files"></div>
                         <?php if(isset($files) && count($files) > 0){
							 	$nomor = 1;
								foreach($files as $r){
								?>
									<div class="file"><?php echo $nomor;?>. 
                                    	<a href="#" class="file_item">Dokumen Pendukung </a>
                                        <a href="<?php echo base_url()."uploaded/formulir/".$r->file_location.$r->file_name;?>" class="download_item" target="_blank">[ download ]</a>
                                    </div>
								<?php
									$nomor++;
								}
						 }?>
                </td>
			</tr>            
			
		</table>
        <h3 style="padding:10px 0px; font-size:15px;">Data Selengkapnya </h3>
        <table class="table-form" style="width:95%;" id="table-form" border="0">
        	<tr>
				<td>Jasa Penjamin</td>
				<td><input type="text" id="form_jasa_penjamin" name="form_jasa_penjamin" disabled="disabled"  class="validate[required]"size="50" value="<?php echo isset($val->form_jasa_penjamin)?$val->form_jasa_penjamin:'';?>" /></td>
			</tr>
            <tr>
				<td>Biaya Administrasi</td>
				<td><input type="text" id="form_biaya_administrasi" name="form_biaya_administrasi" disabled="disabled" class="validate[required]"size="50" value="<?php echo isset($val->form_biaya_administrasi)?$val->form_biaya_administrasi:'';?>" /></td>
			</tr>
            <tr>
				<td>Bea Materai</td>
				<td><input type="text" id="form_bea_materai" name="form_bea_materai" disabled="disabled" class="validate[required]"size="50" value="<?php echo isset($val->form_bea_materai)?$val->form_bea_materai:'';?>" /></td>
			</tr>
            <tr>
				<td>Hak Asuransi</td>
				<td><input type="text" id="form_hak_asuransi" name="form_hak_asuransi" disabled="disabled" class="validate[required]"size="50" value="<?php echo isset($val->form_hak_asuransi)?$val->form_hak_asuransi:'';?>" /></td>
			</tr>
            <tr>
				<td>Hak Bank</td>
				<td><input type="text" id="form_hak_bank" name="form_hak_bank" disabled="disabled"  class="validate[required]"size="50" value="<?php echo isset($val->form_hak_bank)?$val->form_hak_bank:'';?>" /></td>
			</tr>
			<tr>
				<td style="padding:5px;">Status</td>
				<td>
                	<b><?php echo $val->form_status;?></b>
				</td>
			</tr>
            <tr valign="top">
				<td>Catatan</td>
				<td>
                <?php
				  $nnt=get_note(array(
				  	"form_id"	=> $val->form_id,
					"asuransi_id"	=> $this->jCfg['user']['asuransi']
				  ));
				  if(count($nnt)>0){	
					  echo ($nnt[0]->note_read=="0")?"<b>":"";
					  echo "Klik disini untuk melihat Note : <a href='".$own_links."get_note/".$val->form_id."' id='link_note' class='simple'><img src='".themeUrl()."images/unread.png'></a>";
					  echo ($nnt[0]->note_read=="0")?"</b>":"";
					  ?>
					  <script language="javascript">
					  var url_note = '<?php echo $own_links."get_note/".$val->form_id;?>';
					  $.modal('<iframe src="' + url_note + '" height="400px" width="600px" style="border:0">', {});
					  </script>
					  <?php
				  }
				?>
                </td>
			</tr>
			<tr>
				<td><input type="reset" onclick="document.location='<?php echo $own_links;?>'" class="btnbatal" value="Batal" /></td>
				<td align="right"></td>
			</tr>
       </table>
	</form>
